use std::result;

use thiserror::Error;

#[derive(Debug, Error, PartialEq)]
pub enum DbErrors {

    #[error("failed to open data file")]
    FailToOpenDataFile,

    #[error("failed read from data file")]
    FailedReadFromDataFile,

    #[error("failed write from data file")]
    FailToWriteDataFile,

    #[error("failed sync data file")]
    FailedSyncDataFile,

    #[error("Read data file EOF")]
    ReadDataFileEOF,

    #[error("invalid log record crc")]
    InvalidLogRecordCrc,

}

pub type Result<T> = result::Result<T, DbErrors>;
